package com.lly.tboc

import com.google.gson.Gson
import org.junit.Test

class YaoTest {
    val test_data = """
{
    "count": 1,
    "has_next": 0,
    "data": [
        {
            "id": 1,
            "name": "乾",
            "wu": "易知",
            "xiang": "天行健 君子以自强不息",
            "data": [
                {
                    "id": 1,
                    "name": "初九",
                    "ci": "潜龙勿用",
                    "xiang": "阳在下也",
                    "wu": "草里冬瓜"
                }
            ]
        }
    ]
}
    """.trimIndent()

    @Test
    fun test() {
        var gua = Gson().fromJson(test_data, com.lly.tboc.zhouyi.vo.GuaDatas::class.java).data[0]
        print(gua)
        assert(gua.data.size == 1)
        assert(gua.name == "乾")
        assert(gua.data[0].name == "初九")
    }
}